<template>
  <view class="content">
    <view class="title">{{ data.name }}</view>
    <view class="neirong">
      <rich-text :nodes="data.content"></rich-text>
    </view>
  </view>
</template>

<script>
import { api } from "@/utils/api.js";
export default {
  data() {
    return {
      data: {},
    };
  },
  onLoad(e) {
    console.log(e);
    this.getDetail(e);
  },
  methods: {
    async getDetail(e) {
      let res;
      if (e.type == 1) {
        // 承诺函
        res = await api.getPromise({ projectId: e.projectId });
      } else if (e.type == 2) {
        // 竞价须知
        res = await api.getInstruction({ projectId: e.projectId });
      } else {
        // 临沂市产权合同
        res = await api.getContract({ projectId: e.projectId });
      }
      console.log(res);
      this.data = res.data;
    },
  },
};
</script>

<style scoped lang="less">
.content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  .title {
    font-size: 34rpx;
    font-weight: 600;
    margin-top: 30rpx;
  }
  .uptime {
    font-size: 28rpx;
    color: #999;
    margin-top: 20rpx;
  }
  .neirong {
    width: 93%;
    margin-top: 20rpx;
  }
}
</style>
